// @ts-ignore
/* eslint-disable */
import {request} from '@umijs/max';
import {BillingListItem, BillingOverview} from './data';

/** 获取租户列表 GET /api/order/list */
export async function billingList(
    params: {
        // query
        /** 当前的页码 */
        current?: number;
        /** 页面的容量 */
        pageSize?: number;
    },
    // data?: { [key: string]: any },
    options?: { [key: string]: any },
) {
    return request<{
        data: BillingListItem[];
        /** 列表的内容总数 */
        total?: number;
        success?: boolean;
    }>('/api/billing/list', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
        // data: {
        //   ...(options || {})
        // }
    });
}


/** 获取租户列表 GET /api/order/list */
export async function billingStatisticsOverview(
    params: {
        organizationId?: string;
        resourceId?: string;
        resourceType?: string;
        billingTimeRange?: string[];
        startTime?: string;
        endTime?: string;
    },
    options?: { [key: string]: any },
) {
    return request<{
        data: BillingOverview;
        success?: boolean;
    }>('/api/statistics/billing/overview', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}
